import { CardEditableParamsDefault } from "@/views/card/js/data/cardDatas/index.js";
import TooltipsData from "@/views/card/js/data/tooltipsData/tooltips-data.js";



export const PanelDatasEditableParamsLists = {
  Panel_1: {
    width: {
      ...CardEditableParamsDefault.SliderNormal,
      label: '宽 (比例)',
      max: 1080,
      tooltips: `默认360`,
    },
    height: {
      ...CardEditableParamsDefault.SliderNormal,
      label: '高 (比例)',
      max: 1280,
      tooltips: `默认160`,
    },
  },
  Panel_2: {
    pic_url: {
      ...CardEditableParamsDefault.ImageNormal,
      label: '图片',
      res_type: 'String',  // Array : fileList, String : value
      placeholder: '尺寸严格按照设置的宽高，小于500kb，jpg,jpeg,png,gif格式',
      limit: 1,
      size: 500,
      accept: '.jpg, .jpeg, .png, .gif',
      // tooltips: TooltipsData.image[1],
    },
    width: {
      ...CardEditableParamsDefault.SliderNormal,
      label: '宽 (比例)',
      max: 1080,
      tooltips: `
        <p>默认360</p>
        <p>IOS下设置宽高比生效；</p>
        <p>安卓下设置宽高比不一定生效，固定 360:160；</p>
      `,

      // ...CardEditableParamsDefault.InputNormal,
      // label: '宽',
      // placeholder: '请填入文本',
    },
    height: {
      ...CardEditableParamsDefault.SliderNormal,
      label: '高 (比例)',
      max: 1280,
      tooltips: `
        <p>默认160</p>
        <p>IOS下设置宽高比生效；</p>
        <p>安卓下设置宽高比不一定生效，固定 360:160；</p>
      `,

      // ...CardEditableParamsDefault.InputNormal,
      // label: '高',
      // placeholder: '请填入文本',
    },
  },
  Panel_3: {
    type: {
      ...CardEditableParamsDefault.DropdownNormal,
      label: '文本样式',
      placeholder: '请选择',
      valLists: [
        {
          name: '正常(默认)',  // default
          value: 'desc',
        },
        {
          name: '粗体',
          value: 'title',
        },
      ],
    },
    text: {
      ...CardEditableParamsDefault.InputNormal,
      label: '文本',
      placeholder: '请填入文本',
      tooltips: `
                <p> 如： \< font color='#636363' \>恭喜成为\< font color='red' \>铁杆粉丝\< \/font \>\< \/font \></p>
                <p>获取用户昵称：{#name}</p>
              `,
    },
    text_alignment: {
      ...CardEditableParamsDefault.DropdownNormal,
      label: '文本对齐',
      placeholder: '请选择',
      valLists: [
        {
          name: '左对齐',  // default
          value: '0',
        },
        {
          name: '居中',
          value: '1',
        },
        {
          name: '右对齐',
          value: '2',
        },
      ],
    },
    Idx_bis_own: {
      ...CardEditableParamsDefault.SwitchNormal,
      label: '获取用户数据(是|否)',
      bIsUpdateManual: true,
      boolReplace: {
        boolTrue: '1',
        boolFalse: '0',
      },
      tooltips: `<p>获取用户个人昵称等</p>`,
    },
    Idx_uid: {
      ...CardEditableParamsDefault.InputNormal,
      label: 'Uid',
      placeholder: '请填入Uid',
      tooltips: `<p>获取该 UID 用户的昵称等</p>`,

      param_effect_parent: {
        effect_parent_keys: ['Idx_bis_own'],
        effect_type: ['SHOW_HIDE'],
        effect_parent_val: '0',
        effect_clear: {
          effect_clear_default_val: '',
        },
      },
    },
  },
  Panel_4: {
    Idx_bis_own: {
      ...CardEditableParamsDefault.SwitchNormal,
      label: '获取用户数据(是|否)',
      bIsUpdateManual: true,
      boolReplace: {
        boolTrue: '1',
        boolFalse: '0',
      },
      tooltips: `<p>获取用户个人头像、标签等</p>`,
    },
    Idx_uid: {
      ...CardEditableParamsDefault.InputNormal,
      label: 'Uid',
      placeholder: '请填入Uid',
      tooltips: `<p>获取该 UID 用户的头像、标签等</p>`,

      param_effect_parent: {
        effect_parent_keys: ['Idx_bis_own'],
        effect_type: ['SHOW_HIDE'],
        effect_parent_val: '0',
        effect_clear: {
          effect_clear_default_val: '',
        },
      },
    },
    avatar_url: {
      ...CardEditableParamsDefault.ImageNormal,
      label: '头像',
      res_type: 'String',  // Array : fileList, String : value
      placeholder: '尺寸严格按照设置的宽高，小于100kb，jpg,jpeg,png格式',
      limit: 1,
      size: 100,
      accept: '.jpg, .jpeg, .png',
    },
    flag_url: {
      ...CardEditableParamsDefault.ImageNormal,
      label: '标签',
      res_type: 'String',  // Array : fileList, String : value
      placeholder: '尺寸严格按照设置的宽高，小于100kb，jpg,jpeg,png,gif格式',
      limit: 1,
      size: 100,
      accept: '.jpg, .jpeg, .png, .gif',
    },
    flag_gif_localname: {
      ...CardEditableParamsDefault.DropdownNormal,
      label: '标签本地文件名',
      placeholder: '请选择',
      tooltips: `<p>默认为空，优先级较 标签(flag_url) 高；</p><p>IOS可正常显示，安卓端不可正常显示；</p>`,
      valLists: [
        {
          name: '无',  // default
          value: '',
        },
        {
          name: '铁杆粉丝',
          value: 'pagealert_flag',
        },
      ],
    }
  },
  Panel_5: {
    Idx_type: {
      ...CardEditableParamsDefault.DropdownNormal,
      label: '进度条样式',
      placeholder: '请选择',
      valLists: [
        {
          name: '多节点样式',
          value: 'multiple',
        },
        {
          name: '百分比样式',
          value: 'double',
        },
      ],
    },
    node_num: {
      ...CardEditableParamsDefault.SliderNormal,
      label: '节点数',
      step: 1,
      max: 100,
      min: 2,
      tooltips: `<p>百分比样式：固定节点个数 = 2</p><p>多节点样式：节点个数 > 2</p>`,

      param_effect_parent: {
        effect_parent_keys: ['Idx_type'],
        effect_type: ['INIT'],
        effect_clear: {
          effect_clear_default_val: 2,
        },
      },
    },
    begin_point: {
      ...CardEditableParamsDefault.InputNormal,
      label: '起始位置(整数)',
      placeholder: '起始位置，以0开始',
      type: 'number',
      tooltips: `<p>取值时：计算节点数 - 1</p>`,

      param_effect_parent: {
        effect_parent_keys: ['Idx_type'],
        effect_type: ['SHOW_HIDE', 'CHANGE_CONFIG'],
        effect_parent_val: 'multiple',
        effect_clear: {
          effect_clear_default_val: 0,
        },
        effect_cofing: {
          multiple: {
            label: '起始位置(整数)',
          },
          double: {
            label: '起始位置(小数)',
          }
        },
      },
    },
    end_point: {
      ...CardEditableParamsDefault.InputNormal,
      label: '结束位置(整数)',
      placeholder: '结束位置',
      type: 'number',
      disabled: true,
      tooltips: `<p>取值时：计算节点数 - 1</p>`,

      param_effect_parent: {
        effect_parent_keys: ['Idx_type'],
        effect_type: ['INIT', 'CHANGE_CONFIG'],
        effect_clear: {
          effect_clear_default_val: 0,
        },
        effect_cofing: {
          multiple: {
            label: '结束位置(整数)',
          },
          double: {
            label: '结束位置(小数)',
          }
        },
      },
    },
    current_text: {
      ...CardEditableParamsDefault.InputNormal,
      label: '节点文案',
      placeholder: '节点文案',

      param_effect_parent: {
        effect_parent_keys: ['Idx_type'],
        effect_type: ['SHOW_HIDE'],
        effect_parent_val: 'multiple',
        effect_clear: {
          effect_clear_default_val: '',
        },
      },
    },
    left_text: {
      ...CardEditableParamsDefault.InputNormal,
      label: '最左侧文案',
      placeholder: '最左侧文案',

      param_effect_parent: {
        effect_parent_keys: ['Idx_type'],
        effect_type: ['SHOW_HIDE'],
        effect_parent_val: 'double',
        effect_clear: {
          effect_clear_default_val: '',
        },
      },
    },
    right_text: {
      ...CardEditableParamsDefault.InputNormal,
      label: '最右侧文案',
      placeholder: '最右侧文案',
    },
  },
  Panel_6: {
    tips: {
      ...CardEditableParamsDefault.Obj,
      label: '选择框参数',
      param_params: {
        tips_text: {
          ...CardEditableParamsDefault.InputNormal,
          label: '提示文本',
          placeholder: 'tips_text',
        },
        has_check_box: {
          ...CardEditableParamsDefault.SwitchNormal,
          label: '选择框(有|无)',
          bIsUpdateManual: true,
          boolReplace: {
            boolTrue: '1',
            boolFalse: '0',
          },
        },
        checked_default: {
          ...CardEditableParamsDefault.SwitchNormal,
          label: '选择框默认是否勾选',
          bIsUpdateManual: true,
          boolReplace: {
            boolTrue: '1',
            boolFalse: '0',
          },

          param_effect_parent: {
            effect_parent_keys: ['tips', 'has_check_box'],
            effect_type: ['SHOW_HIDE'],
            effect_parent_val: '1',
            effect_clear: {
              effect_clear_default_val: '0',
            },
          },
        },
        Idx_checked_type: {
          ...CardEditableParamsDefault.DropdownNormal,
          label: '选择框事件类型',
          placeholder: '请选择',
          valLists: [
            // {
            //   name: '关注',
            //   value: 'WB_FOLLOW',
            // },
            {
              name: '直发博文',
              value: 'WB_PUSH',
            },
          ],

          param_effect_parent: {
            effect_parent_keys: ['tips', 'has_check_box'],
            effect_type: ['SHOW_HIDE'],
            effect_parent_val: '1',
            effect_clear: {
              effect_clear_default_val: '',
            },
          },
        },
      },
    },
    button: {
      ...CardEditableParamsDefault.Obj,
      label: '按钮',
      param_params: {
        type: {
          ...CardEditableParamsDefault.DropdownNormal,
          label: '按钮类型',
          placeholder: '请选择',
          valLists: [
            {
              name: '事件',
              value: 'default',
            },
            {
              name: '链接',
              value: 'link',
            },
          ],
        },
        name: {
          ...CardEditableParamsDefault.InputNormal,
          label: '按钮名称',
          placeholder: '按钮名称',
        },
        params: {
          ...CardEditableParamsDefault.Obj,
          label: '按钮其他参数',
          param_params: {
            action: {
              ...CardEditableParamsDefault.Action,
              label: '按钮事件',
              placeholder: '请选择按钮事件',
              tooltips: TooltipsData.others[1],
            },
            scheme: {
              ...CardEditableParamsDefault.InputNormal,
              label: '按钮链接',
              placeholder: '按钮链接',
            },
          },

          param_effect_parent: {
            effect_parent_keys: ['button', 'type'],
            effect_type: ['CHANGE_PARAMS'],
            effect_obj_params: [
              {
                effect_regular: new RegExp("^link$"),
                effect_new_obj_params: {
                  scheme: '',
                },
              },
              {
                effect_regular: new RegExp("^default$"),
                effect_new_obj_params: {
                  action: '',
                },
              }
            ],
          },
        },
      }
    }
  },
};
